﻿#ifndef ChartView_H
#define ChartView_H

#include <QObject>
#include <QWidget>
#include <QtCharts/QChartView>

using namespace QtCharts;

class ChartView : public QChartView
{
    Q_OBJECT
public:
    explicit ChartView(QChart *chart, QWidget *parent = nullptr);
    QPoint get_cur_mouse_pos();
    ~ChartView();
private:
   QPoint beginPoint;
   QPoint endPoint;

protected:
   void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
   void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE ;
   void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
   void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE ;

signals:
   void mouseMovePoint(QPoint point);
   void keyPressPoint(QKeyEvent *event);

public slots:
};

#endif // ChartView_H
